package com.wangwei.modules.utils;

import java.util.Date;

public class DateUtil {

	public static void main(String[] args) {
		
		Date date=	new Date();
		//Sat May 19 15:31:50 CST 2018
		System.out.println(new Date().toString());
		//19 May 2018 07:31:55 GMT
		System.out.println(new Date().toGMTString());
		//Tue,17Apr200106:46:28GMT
		System.out.println(getHttpDateString(new Date()));
		
	}
	
	
	public static String getHttpDateString(Date date) {
		String[] ds=date.toString().split(" ");
		return ds[0]+","+ds[2]+ds[1]+ds[5]+ds[3]+"GMT";
	}
}
